function XiDingFn(id){
	this.nav = document.getElementById(id);
	this.top = this.nav.offsetTop;
	this.bdy = document.documentElement|| document.body ;
}
XiDingFn.prototype.init = function(){
	var that = this;
	window.onscroll = function(){
		console.log(that.bdy.scrollTop);
		if (that.bdy.scrollTop > 0) {
			that.nav.style.position = "absolute";
			that.nav.style.top = that.bdy.scrollTop + "px";
			that.nav.style.left = "0px";
		}else{
			that.nav.style.position = "";
		}
	}
}
var xdxg = new XiDingFn('xiding');
	xdxg.init();